package pers.ree.demo.base;

public class SubObj extends ParentObj {

    public int i = 30;

    public void print() {
        System.out.println("SubObj print" + i);
    }

    public static void main(String[] args) {
        GrandObj grandObj = new SubObj();
        ParentObj parentObj = new SubObj();
        SubObj subObj = new SubObj();

        System.out.println(grandObj.i);
        System.out.println(parentObj.i);
        System.out.println(subObj.i);

        grandObj.print();
        parentObj.print();
        subObj.print();
    }
}
